// js/state.js
export const gameState = {
    gold: 0,
    currentLayer: 1,
    _listeners: [],

    setGold(value) {
        this.gold = value;
        this._listeners.forEach(fn => fn());
    },

    addListener(fn) {
        this._listeners.push(fn);
    }
};